//
// Created by WenYF on 2016/11/4.
//

#ifndef FZJH_IO_POSIX_H
#define FZJH_IO_POSIX_H

#include "common.h"
#ifdef __cplusplus  
extern "C" {  
#endif  
typedef void (ifTClose)(void *socket);
typedef int (ifTConnect)(void **socket, const char *server, int port);
typedef int (ifTSend)(void *socket, const char *data, size_t len);
typedef int (ifTRecv)(void *socket, char *buffer, size_t buf_len, int timeout);

typedef const struct iftransport_struct {
    ifTConnect *connect;
    ifTSend *send;
    ifTRecv *recv;
    ifTClose *close;
} iftransport;

extern iftransport if_default_transport;

#ifdef __cplusplus  
}  
#endif  
#endif //FZJH_IO_POSIX_H
